<template>
  <div class="coupons" :style="{ '--btn_color': btn_color }">
    <div class="title">
      <span></span>
      <div>活动规则</div>
      <span></span>
      <div class="triangle_left_border"></div>
      <div class="triangle_right_border"></div>
    </div>

    <div class="gift_pop">
      <vm-scrollbar tag="div" :wrapStyle="{ height: height+'px' }">
        <div
          class="conter1"
          v-for="(item, i) in introduce"
          :key="i"
          v-show="introduce"
        >
          <div class="text2" v-html="item.value"></div>
        </div>
        <nodata-piz v-show="!introduce.length"></nodata-piz>
      </vm-scrollbar>
    </div>
  </div>
</template>

<script>
import { Icon } from "vant";
import NodataPiz from "./NodataPiz.vue";

export default {
  components: {
    [Icon.name]: Icon,
    NodataPiz,
  },
  props: {
    activityItem: {
      type: Object,
      required: true,
    },
  },
  data() {
    return {
      btn_color: "",
      introduce: [],
      height: null
    };
  },
  created() {
    this.btn_color = this.activityItem.btn_color;
    this.introduce = this.activityItem.introduce;
    
  },
  mounted() {
    this.height= document.documentElement.clientHeight*0.40
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
.seamless-warp {
  height: 28rem;
  overflow: hidden;
}
.coupons {
  margin: 3.5rem 0 1rem 0;
  // width: 90%;
  background-color: #fff;
  border-radius: 8px;
  padding: 1.5rem 1rem 1rem;
  box-sizing: border-box;
  position: relative;
  // overflow: hidden;
  .title {
    width: 12rem;
    height: 3rem;
    background: var(--btn_color);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    line-height: 3rem;
    text-align: center;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    letter-spacing: 0.3rem;
    font-size: 1.4rem;
    span {
      display: inline-block;
      width: 1rem;
      height: 1rem;
      border-radius: 1rem;
      background-color: #ffdb89;
    }
    span:nth-child(1) {
      margin-right: 0.5rem;
    }
    span:nth-child(2) {
      margin-left: 0.2rem;
    }
    .triangle_left_border {
      width: 0;
      height: 0;
      border-bottom: 1.5rem solid var(--btn_color);
      border-left: 1.5rem solid transparent;
      position: absolute;
      left: 0%;
      top: 0%;
      margin-left: -1.5rem;
    }
    .triangle_right_border {
      width: 0;
      height: 0;
      border-bottom: 1.5rem solid var(--btn_color);
      border-right: 1.5rem solid transparent;
      position: absolute;
      left: 100%;
      top: 0%;
    }
  }

  .gift_pop {
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: auto;
    background-color: white;
    position: relative;
    // padding: 2rem 0;

    .conter1 {
      box-sizing: border-box;
      display: flex;
      // height: 10rem;
      // border: 1px solid #979797;
      padding: 0 1rem;
      // margin: 1rem 0 0;s
      .text2 {
        // color: #ffdb89;
        line-height: 2.4rem;
        p {
        }
      }
    }
  }
}
</style>